using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Backend.JYD.Model.Credit;

namespace Backend.JYD.EFDAL.Mapping
{
    public class CreditHistoryMap : EntityTypeConfiguration<CreditHistory>
    {
        public CreditHistoryMap()
        {
            // Primary Key
            this.HasKey(t => t.CreditId);

            // Properties
            this.Property(t => t.CustNo)
                .HasMaxLength(20);

            this.Property(t => t.Desc)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("CreditHistory");
            this.Property(t => t.CreditId).HasColumnName("CreditId");
            this.Property(t => t.CustNo).HasColumnName("CustNo");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Desc).HasColumnName("Desc");
            this.Property(t => t.IsValid).HasColumnName("IsValid");
            this.Property(t => t.TaskId).HasColumnName("TaskId");
            this.Property(t => t.TaskDetailId).HasColumnName("TaskDetailId");
        }
    }
}
